@extends('layouts.app')

@section('content')
<div class="container">
    <div class="row">
    	<div class="col-md-8 col-md-offset-2 ">
    		<div class="panel panel-default user-indeximghead" data-toggle="modal" data-target="#myModal">
    				@if(empty($user->avatar))
                    <img src="{{ asset('images/who.jpg') }}" />
                    @else
                    <img src="{{ $user->avatar }}" />
                    @endif
            		<p>{{ $user->name }}</p>
           </div>
           <!-- Modal -->
			<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
			  <div class="modal-dialog">
			    <div class="modal-content">
			      <div class="modal-header">
			        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
			        <h4 class="modal-title" id="myModalLabel">{{ $user->name }}</h4>
			      </div>
			      <div class="modal-body user-indexmodel">
			        <img src="http://qr.topscan.com/api.php?text={{ $share_url }}" />
			        <p>扫描上方二维码，立即加入平台。</p>
			      </div>
			      <div class="modal-footer">
			        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
			      </div>
			    </div>
			  </div>
			</div>
        </div>
        <div class="col-md-8 col-md-offset-2">
            <div class="panel panel-default">
                <div class="panel-heading">佣金统计</div>
                <div class="panel-body">
                    <ul class="list-group user-indexulmag">
						<li class="list-group-item">
							<p>累计佣金</p>
							<span class="glyphicon form-control-feedback">{{ $yescommissions+$nocommissions }}元</span>
						</li>
						<li class="list-group-item">
							<p>已分配佣金</p>
							<span class="glyphicon form-control-feedback">{{ $yescommissions }}元</span>
						</li>
						<li class="list-group-item">
							<p>未分配佣金</p>
							<span class="glyphicon form-control-feedback">{{ $nocommissions }}元</span>
						</li>
					</ul>
                </div>
            </div>
        </div>
        <div class="col-md-8 col-md-offset-2">
            <ul class="list-group user-indexulmag">
				<li class="list-group-item">
					<a href="{{ url('/commission/subordinates') }}">
						<p>我的经纪人</p>
						<span class="glyphicon form-control-feedback">{{ $subordinates }}人</span>
					</a>
				</li>
				<li class="list-group-item">
					<a href="{{ url('/commission/details') }}">
						<p>佣金明细</p>
						<span class="glyphicon form-control-feedback"></span>
					</a>
				</li>
			</ul>
        </div>
    </div>
</div>
@endsection
